package com.ckzp.weixin.wxpay;

import com.ckzp.core.ConfigUtil;

/**
 * Created by 51594 on 2019/11/21.
 */
public class Logger {

    public static boolean DEBUG = ConfigUtil.DEBUG();

    public static Logger getInstance() {
        return new Logger();
    }

    public void warn(String err, String msg, String xml) {
        if (DEBUG) {
            System.out.println("------------------------------warn------------------");
            System.out.println("---err:" + err);
            System.out.println("---err:" + msg);
            System.out.println("---err:" + xml);
            System.out.println("------------------------------warn end------------------");
        }
    }

    public void info(String msg) {
        if (DEBUG) {
            System.out.println("------------------------------info------------------");
            System.out.println("---msg:" + msg);
            System.out.println("------------------------------info end------------------");
        }
    }

    public void info(String msg, int num) {
        if (DEBUG) {
            System.out.println("------------------------------info------------------");
            System.out.println("---msg:" + msg);
            System.out.println("---num:" + num);
            System.out.println("------------------------------info end------------------");
        }
    }

    public void info(String err, String msg) {
        if (DEBUG) {
            System.out.println("------------------------------info------------------");
            System.out.println("---err:" + err);
            System.out.println("---err:" + msg);
            System.out.println("------------------------------info end------------------");
        }
    }

    public void warn(String err, String msg) {
        if (DEBUG) {
            System.out.println("------------------------------warn------------------");
            System.out.println("---err:" + err);
            System.out.println("---err:" + msg);
            System.out.println("------------------------------warn end------------------");
        }
    }

    public void warn(String err, IWXPayDomain.DomainInfo info) {
        if (DEBUG) {
            System.out.println("------------------------------warn------------------");
            System.out.println("---err:" + err);
            System.out.println("---info:" + info.toString());
            System.out.println("------------------------------warn end------------------");
        }
    }

}
